package biz.ezcom.design.pattern.composite;

public class Client {
	public static void main(String[] args) {
		Composite root = new Component(0,"根");
		root.add(new Leaf(1,"叶A"));
		root.add(new Leaf(1,"叶B"));
		
		Component nodeA = new Component(1,"节点A");
		Component nodeB = new Component(1,"节点B");
		root.add(nodeA);
		root.add(nodeB);
		
		Leaf leafC = new Leaf(2,"叶C");
		Leaf leafD = new Leaf(2,"叶D");
		nodeA.add(leafC);
		nodeA.add(leafD);
		
		root.show();
		
	}
}
